normal text italic text bold text bold italic text

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

unordered lists

  • first item in the list
  • second item in the list
  • third item in the list

ordered lists

  1. first item in the list
  2. second item in the list
  3. third item in the list

this text will be quoted

this text will appear as code inline

evaluate r code inline

the value of parameter a is `variable a ## Images Provide either a path to a local image file or the URL of an image.

Resize Images

print('hello world!')
## [1] "hello world!"

Installation

Install ‘gapminder’ from CRAN:

install.packages("gapminder")

Or you can install ‘gapminder’ from Github:

devtools::install_github("jennybc/gapminder")

Load and test

library("gapminder")
## Warning: package 'gapminder' was built under R version 3.4.4
aggregate(lifeExp ~ continent, gapminder, median)
##   continent lifeExp
## 1    Africa 47.7920
## 2  Americas 67.0480
## 3      Asia 61.7915
## 4    Europe 72.2410
## 5   Oceania 73.6650
#>   continent lifeExp
#> 1    Africa 47.7920
#> 2  Americas 67.0480
#> 3      Asia 61.7915
#> 4    Europe 72.2410
#> 5   Oceania 73.6650

library("dplyr")
## Warning: package 'dplyr' was built under R version 3.4.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
gapminder %>%
    filter(year == 2007) %>%
    group_by(continent) %>%
    summarise(lifeExp = median(lifeExp))
## Warning: package 'bindrcpp' was built under R version 3.4.4
## # A tibble: 5 x 2
##   continent lifeExp
##   <fct>       <dbl>
## 1 Africa       52.9
## 2 Americas     72.9
## 3 Asia         72.4
## 4 Europe       78.6
## 5 Oceania      80.7
#> # A tibble: 5 x 2
#>   continent lifeExp
#>      <fctr>   <dbl>
#> 1    Africa 52.9265
#> 2  Americas 72.8990
#> 3      Asia 72.3960
#> 4    Europe 78.6085
#> 5   Oceania 80.7195
    
library("ggplot2")
## Warning: package 'ggplot2' was built under R version 3.4.4
ggplot(gapminder, aes(x = continent, y = lifeExp)) +
  geom_boxplot(outlier.colour = "hotpink") +
  geom_jitter(position = position_jitter(width = 0.1, height = 0), alpha = 1/4)

Displaying interactive DT::datatable() tables

library(DT)
## Warning: package 'DT' was built under R version 3.4.4
data(airquality)
datatable(airquality, caption = "New York Air Quality Measurements")